from json import JSONDecodeError
from sqlite3 import connect
import json

con=connect(r"D:\易刊蝦皮助理國際版\shopeemy.sqlite")
cur=con.cursor()
cur.execute('select * from itemview')
for i in cur:
    dataRows=i[12]
    url=i[23]
    try:
        str_to_dict=json.loads(dataRows)[0]
    except JSONDecodeError:
        continue
    text1=''
    if len(str_to_dict['dataRows'])>2:
        for ii in range(len(str_to_dict['dataRows'])):
            text=str_to_dict['dataRows'][ii]['name']+'\t'
            text1=text+text1
        print(url+'\t'+text1)



